package com.hud.easynavi;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

/**
 * Created by lucian on 17-3-24.
 */

public class MirrorRelativeLayout extends RelativeLayout {
    public MirrorRelativeLayout(Context context) {
        super(context);
    }

    public MirrorRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MirrorRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public MirrorRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        canvas.scale(1f,-1f,getWidth(),getHeight()/4);
        super.dispatchDraw(canvas);
    }
}
